﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace LiveEduWizard.Filter
{
    public class AndFilterRule : IFilterRule
    {
        public LinkedList<IFilterRule> FilterRules { get; private set; }

        public AndFilterRule()
        {
            FilterRules = new LinkedList<IFilterRule>();
        }

        public AndFilterRule(IEnumerable<IFilterRule> filterRules)
        {
            FilterRules = new LinkedList<IFilterRule>(filterRules);
        }

        public bool IsMatch(AppointmentViewModel appointment)
        {
            foreach (var rule in FilterRules)
                if (!rule.IsMatch(appointment))
                    return false;

            return true;
        }
    }
}
